﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;

namespace EzDesk.Core.Model
{
    [DataContract]
    public class SimpleUser 
    {
        [DataMember]
        public virtual Guid Id { get; set; }

        [DataMember]
        public virtual string Name { get; set; }

        [DataMember]
        public virtual string UserName { get; set; }
        
        [DataMember]
        public virtual Dept Dept { get; set; }

        [DataMember]
        public virtual Position Position { get; set; }
    }

    public static class SimpleUserExt
    {
        public static bool ContainUser(this IList<SimpleUser> list, SimpleUser user)
        {
            return list.Any(simpleUser => simpleUser.Id == user.Id);
        }
    }

}
